#ifndef QRSAGSMAPSWIPETOOL_H
#define QRSAGSMAPSWIPETOOL_H

#include <QPoint>
#include <QCursor>
#include <QPixmap>
#include <QMessageBox>

#include "qgsmaptool.h"
#include "qgsproject.h"
#include "qgsmapsettings.h"
#include "qgsmaprendererparalleljob.h"
#include "qrsagsmapswipe.h"
#include "qgsmapcanvas.h"
#include "qgslayertree.h"
#include "qgslayertreeview.h"

class QRSAGSMapSwipeTool : public QgsMapTool
{
public:
    QRSAGSMapSwipeTool(QgsMapCanvas *mapCanvas = nullptr, QgsLayerTreeView * layerTreeVeiw = nullptr);
    ~QRSAGSMapSwipeTool();

    QgsMapCanvas *mMapCanvas = nullptr;
    QgsLayerTreeView *mLayerTreeView = nullptr;

    QPoint mFirstPoint;
    QCursor mCursorV, mCursorH;

    QRSAGSMapSwipe *mMapSwipe = nullptr;
    bool checkDirection = false;
    bool hasSwipe = false;
    bool disableSwipe = false;
    int mDirection = 0;

    void activateConnect();

signals:
    void deactivateConnect();
    // QgsMapTool interface
public:
    void canvasMoveEvent(QgsMapMouseEvent *event);
    void canvasPressEvent(QgsMapMouseEvent *event);
    void canvasReleaseEvent(QgsMapMouseEvent *event);
    void activate();
    void deactivate();

private slots:
    void setMap();
    void disable();
    void setLayerSwipe();
};

#endif // QRSAGSMAPSWIPETOOL_H
